package com.info.widgets.Joiningformalities;
import java.util.ArrayList;
import java.util.List;
import java.sql.*;

import com.info.widgets.ConnectionHelper;
import com.info.widgets.DAOException;
import com.info.widgets.FeedBack.FeedBack;
import com.info.widgets.Joiningformalities.Joiningformalities;
public class JoiningformalitiesService {
	public ArrayList<Joiningformalities> JoiningformalitiesCreation(Joiningformalities join) throws DAOException{
		System.out.println("JoiningformalitiesCreation");
		Joiningformalities join1=new Joiningformalities();
		Connection con=null;
		String dbtime=null;
		//String query="SELECT * FROM mycaspian.joining_formalities";
		ArrayList<Joiningformalities> arrayList = new ArrayList<Joiningformalities>();
		try {
			con=ConnectionHelper.getConnection();
			Statement stmt=con.createStatement();
			//ResultSet rs=stmt.executeQuery(query);
			PreparedStatement pst = null;
			pst = con.prepareStatement("INSERT INTO Joiningformalities (positionapplied, name, dateofbirth, male, female, placeofbirth, prefferdlocation, latestphotograph, presentaddress, permanentaddress, contactnumber, email, mothertounge, passportnumber, languages, placeofissue, dateofissue, validtill, married, single, totalexperience, lastrevisedon, nextrevisedon, grosssalary, joiningtime, grossmonthly, grossannual, indays, yes, no, place, date, signature) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
			
			pst.setString(1,join.getPositionapplied());
			
			
			pst.executeUpdate();
		} catch (Exception e) {
			e.printStackTrace();
			throw new DAOException(e);
			
		}finally {
			ConnectionHelper.close(con);
			
		}
		 return arrayList;
		
		
		
	}
}